<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    <title>乐优商城--购物车页面</title>

    <link rel="stylesheet" type="text/css" href="/css/webbase.css"/>
    <link rel="stylesheet" type="text/css" href="/css/pages-cart.css"/>
</head>

<body>

<div id="cartApp">

    <div class="top">
        <shortcut/>
    </div>

    <div class="cart py-container">

        <!--logoArea-->
        <div class="logoArea">
            <div class="fl logo"><span class="title">购物车</span></div>
        </div>

        <!--All Goods-->
        <div class="allgoods">
            <h4>全部商品<span id="count"></span></h4>
            <div class="cart-main">
                <div class="yui3-g cart-th">
                    <div class="yui3-u-1-4"><input type="checkbox" v-model="check" class="checkAll"/> 全部</div>
                    <div class="yui3-u-1-4">商品</div>
                    <div class="yui3-u-1-8">单价（元）</div>
                    <div class="yui3-u-1-8">数量</div>
                    <div class="yui3-u-1-8">小计（元）</div>
                    <div class="yui3-u-1-8">操作</div>
                </div>
                <div class="cart-item-list">
                    <!--<div class="cart-body">
                        <div class="cart-list" style="display: block">
                            <ul class="goods-list yui3-g" v-for="(cart,index) in carts" :key="index">
                                <li class="yui3-u-1-24">
                                    <input type="checkbox" name="" :value="cart" v-model="selected"value="" />
                                </li>
                                <li class="yui3-u-11-24">
                                    <div class="good-item">
                                        <div class="item-img"><img :src="cart.image" width="80px" height="80px"/></div>&lt;!&ndash;商品图片&ndash;&gt;
                                        <div class="item-msg">
												<span style="line-height:70px ">
													商品名字
                                                   &lt;!&ndash; <span v-for="(val,key,index) in JSON.parse(cart.ownSpec)">{{val}}&emsp;</span>&ndash;&gt;
												</span>
                                        </div>
                                    </div>
                                </li>
                                <li class="yui3-u-1-8"><span style="line-height:70px " class="price">单价</span></li>
                                <li class="yui3-u-1-8" style="padding-top: 20px">
                                    <a href="javascript:void(0)" class="increment mins" @click="decr(cart)">-</a>
                                    <input autocomplete="off" type="text" v-model="cart.num" value="1" minnum="1" class="itxt" />
                                    <a href="javascript:void(0)" class="increment plus" @click="incr(cart)">+</a>
                                </li>
                                <li class="yui3-u-1-8"><span style="line-height:70px " class="sum">小合计</span></li>
                                <li class="yui3-u-1-8">
                                    <a href="javascript:void (0);" @click="deleteCart(index)">删除</a><br />
                                    <a href="#none">移到我的关注</a>
                                </li>
                            </ul>
                        </div>
                    </div>-->
                </div>
            </div>
            <div class="cart-tool">
                <div class="select-all">
                    <input type="checkbox" name="" id="" value=""/>
                    <span>全选</span>
                </div>
                <div class="option">
                    <a href="#none">删除选中的商品</a>
                    <a href="#none">移到我的关注</a>
                    <a href="#none">清除下柜商品</a>
                </div>
                <div class="toolbar">
                    <div class="chosed">已选择<span class="count">0</span>件商品</div>
                    <div class="sumprice">
                        <span><em>总价（不含运费） ：</em><i class="summoney">0</i></span>
                        <span><em>已节省：</em><i>0</i></span>
                    </div>
                    <form method="post" action="/shopping/query/cart/list">
                        <input type="hidden" name="map" class="gId" value="" >
                        <input type="submit" value="submit" style="display: none">
                    </form>
                    <div class="sumbtn">
                        <a class="sum-btn balance"  target="_blank">结算</a>
                    </div>
                </div>
            </div>
            <div class="clearfix"></div>
            <div class="deled">
                <span>已删除商品，您可以重新购买或加关注：</span>
                <div class="cart-list del">
                    <ul class="goods-list yui3-g">
                        <li class="yui3-u-1-2">
                            <div class="good-item">
                                <div class="item-msg">Apple Macbook Air 13.3英寸笔记本电脑 银色（Corei5）处理器/8GB内存</div>
                            </div>
                        </li>
                        <li class="yui3-u-1-6"><span class="price">8848.00</span></li>
                        <li class="yui3-u-1-6">
                            <span class="number">1</span>
                        </li>
                        <li class="yui3-u-1-8">
                            <a href="#none">重新购买</a>
                            <a href="#none">移到我的关注</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div>
                <button type="button" value="0" class="pageIndex">
                    上一页
                </button>
                <input type="text" value="0" class="index" width="100px"/>
                <button type="button" value="1" class="pageIndex">
                    下一页
                </button>
                总页数: <input type="text" class="totalPage" value="0"/>
                共<div class="totalRows"></div>件商品
            </div>
            <div class="liked">
                <ul class="sui-nav nav-tabs">
                    <li class="active">
                        <a href="#index" data-toggle="tab">猜你喜欢</a>
                    </li>
                    <li>
                        <a href="#profile" data-toggle="tab">特惠换购</a>
                    </li>
                </ul>
                <div class="clearfix"></div>
                <div class="tab-content">
                    <div id="index" class="tab-pane active">
                        <div id="myCarousel" data-ride="carousel" data-interval="4000" class="sui-carousel slide">
                            <div class="carousel-inner">
                                <div class="active item">
                                    <ul>
                                        <li>
                                            <img src="/img/like1.png"/>
                                            <div class="intro">
                                                <i>Apple苹果iPhone 6s (A1699)</i>
                                            </div>
                                            <div class="money">
                                                <span>$29.00</span>
                                            </div>
                                            <div class="incar">
                                                <a href="#" class="sui-btn btn-bordered btn-xlarge btn-default"><i
                                                        class="car"></i><span class="cartxt">加入购物车</span></a>
                                            </div>
                                        </li>
                                        <li>
                                            <img src="/img/like2.png"/>
                                            <div class="intro">
                                                <i>Apple苹果iPhone 6s (A1699)</i>
                                            </div>
                                            <div class="money">
                                                <span>$29.00</span>
                                            </div>
                                            <div class="incar">
                                                <a href="#" class="sui-btn btn-bordered btn-xlarge btn-default"><i
                                                        class="car"></i><span class="cartxt">加入购物车</span></a>
                                            </div>
                                        </li>
                                        <li>
                                            <img src="/img/like3.png"/>
                                            <div class="intro">
                                                <i>Apple苹果iPhone 6s (A1699)</i>
                                            </div>
                                            <div class="money">
                                                <span>$29.00</span>
                                            </div>
                                            <div class="incar">
                                                <a href="#" class="sui-btn btn-bordered btn-xlarge btn-default"><i
                                                        class="car"></i><span class="cartxt">加入购物车</span></a>
                                            </div>
                                        </li>
                                        <li>
                                            <img src="/img/like4.png"/>
                                            <div class="intro">
                                                <i>Apple苹果iPhone 6s (A1699)</i>
                                            </div>
                                            <div class="money">
                                                <span>$29.00</span>
                                            </div>
                                            <div class="incar">
                                                <a href="#" class="sui-btn btn-bordered btn-xlarge btn-default"><i
                                                        class="car"></i><span class="cartxt">加入购物车</span></a>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                                <div class="item">
                                    <ul>
                                        <li>
                                            <img src="/img/like1.png"/>
                                            <div class="intro">
                                                <i>Apple苹果iPhone 6s (A1699)</i>
                                            </div>
                                            <div class="money">
                                                <span>$29.00</span>
                                            </div>
                                            <div class="incar">
                                                <a href="#" class="sui-btn btn-bordered btn-xlarge btn-default"><i
                                                        class="car"></i><span class="cartxt">加入购物车</span></a>
                                            </div>
                                        </li>
                                        <li>
                                            <img src="/img/like2.png"/>
                                            <div class="intro">
                                                <i>Apple苹果iPhone 6s (A1699)</i>
                                            </div>
                                            <div class="money">
                                                <span>$29.00</span>
                                            </div>
                                            <div class="incar">
                                                <a href="#" class="sui-btn btn-bordered btn-xlarge btn-default"><i
                                                        class="car"></i><span class="cartxt">加入购物车</span></a>
                                            </div>
                                        </li>
                                        <li>
                                            <img src="/img/like3.png"/>
                                            <div class="intro">
                                                <i>Apple苹果iPhone 6s (A1699)</i>
                                            </div>
                                            <div class="money">
                                                <span>$29.00</span>
                                            </div>
                                            <div class="incar">
                                                <a href="#" class="sui-btn btn-bordered btn-xlarge btn-default"><i
                                                        class="car"></i><span class="cartxt">加入购物车</span></a>
                                            </div>
                                        </li>
                                        <li>
                                            <img src="/img/like4.png"/>
                                            <div class="intro">
                                                <i>Apple苹果iPhone 6s (A1699)</i>
                                            </div>
                                            <div class="money">
                                                <span>$29.00</span>
                                            </div>
                                            <div class="incar">
                                                <a href="#" class="sui-btn btn-bordered btn-xlarge btn-default"><i
                                                        class="car"></i><span class="cartxt">加入购物车</span></a>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <a href="#myCarousel" data-slide="prev" class="carousel-control left">‹</a>
                            <a href="#myCarousel" data-slide="next" class="carousel-control right">›</a>
                        </div>
                    </div>
                    <div id="profile" class="tab-pane">
                        <p>特惠选购</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--<form id="subForm" action="" method="get">
        <input type="hidden" name="abc" value="" id="abc"/>
    </form>-->
</div>
<!--<script src="/js/vue/vue.js"></script>-->
<script src="/js/axios.min.js"></script>
<script src="/js/common.js"></script>
<script type="text/javascript">
    var cartVm = new Vue({
        el: "#cartApp",
        data: {
            ly,
            carts: [],
            selected: [],
            check: true
        },
        created(){
          ly.verify().then(res=>{
              ly.http.get("/cart").then(({data}) =>{
                  this.carts = data;
                  this.selected = this.carts;
              });
          }).catch(()=>{
              //未登录购物车的查询
              this.carts = ly.store.get("LY_CART");
              this.selected = this.carts;
          })
        },
        watch: {
          check(newVal){
              if (newVal){
                  this.selected = this.carts;
              }else{
                  this.selected = [];
              }
          }
        },
        computed: {
          total(){
              return this.selected.reduce((c1,c2)=> c1 + c2.num,0);
          },
          totalPrice(){
              return this.selected.reduce((c1,c2)=>c1+c2.num * c2.price,0);
          }
        },
        methods: {
          incr(cart){
              cart.num++;
              ly.verify().then(res=>{
                ly.http.put("/cart",{skuId: cart.skuId,num: cart.num});
              }).catch(()=>{
                  //未登录购物车的查询
                  ly.store.set("LY_CART",this.carts);
              })
          },
          decr(cart){
              if (cart.num>1){
                  cart.num--;
              }
              ly.verify().then(res=>{
                  ly.http.put("/cart",{skuId: cart.skuId,num: cart.num});
              }).catch(()=>{
                  //未登录购物车的查询
                  ly.store.set("LY_CART",this.carts);
              })
          },
          deleteCart(index){
              ly.verify().then(res=>{

              }).catch(()=>{
                  //未登录购物车的查询
                  this.carts.splice(index,1);
                  ly.store.set("LY_CART",this.carts);
              })
          }
        },
        components: {
            shortcut: () => import("/js/pages/shortcut.js")
        }
    })
</script>
<!-- 底部栏位 -->
<!--页面底部，由js动态加载-->
<script type="text/javascript" src="/js/plugins/jquery/jquery.min.js"></script>
<div class="clearfix footer"></div>
<script type="text/javascript">$(".footer").load("foot.html");</script>
<!--页面底部END-->
<script type="text/javascript" src="/js/plugins/jquery.easing/jquery.easing.min.js"></script>
<script type="text/javascript" src="/js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="/js/widget/nav.js"></script>

</body>
<script type="text/javascript">
    var goodsRequestDto={

    }
    $.ajax({
        url:"/shopping/cart/list",
        type:"get",
        data:goodsRequestDto,
        dataType:"json",
        success:function (s) {
            console.log(s);
            $(".totalPage").val(s.data.totalPage);
            $(".index").val(s.data.pageIndex);
            $(".totalRows").text(s.data.totalRows);
            for (let i = 0; i < s.data.shoppingCartDtoList.length; i++) {
                $(".cart-item-list").append("<div class=\"cart-body\">\n" +
                    "<div class='cartId' style='display: none'>"+s.data.shoppingCartDtoList[i].id+"</div>\n"+
                    "                        <div class=\"cart-list\" style=\"display: block\">\n" +
                    "                            <ul class=\"goods-list yui3-g\" v-for=\"(cart,index) in carts\" :key=\"index\">\n" +
                    "                                <li class=\"yui3-u-1-24\">\n" +
                    "                                    <input type=\"checkbox\"     class='checkbox'  name=\"\" :value=\"cart\" v-model=\"selected\"value=\"\" />\n" +
                    "                                </li>\n" +
                    "                                <li class=\"yui3-u-11-24\">\n" +
                    "                                    <div class=\"good-item\">\n" +
                    "                                        <div class=\"item-img\">" +
                    "                                       <img class="+s.data.shoppingCartDtoList[i].gid+" src="+s.data.shoppingCartDtoList[i].goodsImg+" width=\"80px\"  height=\"80px\"/></div><!--商品图片-->\n" +
                    "                                        <div class=\"item-msg\">\n" +
                    "<span style=\"line-height:70px \" class="+s.data.shoppingCartDtoList[i].id+">" +s.data.shoppingCartDtoList[i].productName+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+s.data.shoppingCartDtoList[i].shopName+"</span>\n" +
                    "                                        </div>\n" +
                    "                                    </div>\n" +
                    "                                </li>\n" +
                    "                                <li class=\"yui3-u-1-8\"><span style=\"line-height:70px \" class=\"price\">"+s.data.shoppingCartDtoList[i].price+"</span></li>\n" +
                    "                                <li class=\"yui3-u-1-8\" style=\"padding-top: 20px\">\n" +
                    "                                    <a href=\"javascript:void(0)\" class=\"increment mins\" @click=\"decr(cart)\" >-</a>\n" +
                    "                                    <input autocomplete=\"off\" type=\"text\" v-model=\"cart.num\" value="+s.data.shoppingCartDtoList[i].quantity+" minnum=\"1\" class=\"itxt\" />\n" +
                    "                                    <a href=\"javascript:void(0)\" class=\"increment plus\" @click=\"incr(cart)\">+</a>\n"+
                    "                                </li>\n" +
                    "                                <li class=\"yui3-u-1-8\"><span style=\"line-height:70px \" class=\"sum\">"+(s.data.shoppingCartDtoList[i].quantity*s.data.shoppingCartDtoList[i].price)+"</span></li>\n" +
                    "                                <li class=\"yui3-u-1-8\">\n" +
                    "                                   <a class='cid' style='display: none'>"+s.data.shoppingCartDtoList[i].id+"</a>"+
                    "                                    <a  class='delete' id="+s.data.shoppingCartDtoList[i].id+">删除</a><br />\n" +
                    "                                    <a href=\"#none\">移到我的关注</a>\n" +
                    "                                </li>\n" +
                    "                            </ul>\n" +
                    "                        </div>\n" +
                    "                    </div>");
            }
        }
    })
    let booflag = true;
    /*全选*/
    $(document).on('click','.checkAll',function () {
        let arr = $('.checkbox');
            for(let i=0;i<arr.length;i++){
                arr[i].checked = booflag;
            }
        booflag=!booflag;
            if (booflag==!true){
                    let amount=$(".sum");
                let amounts=0;
                for (let i = 0; i <amount.length; i++) {
                    amounts+=parseInt(amount[i].innerText);
                }
                $(".count").text(arr.length);       //商品数量
                $(".summoney").text(amounts);       //总价
            }else {
                $(".count").text(0);
                $(".summoney").text(0);
            }
    })
    /*选择*/
    var count=0;
    var money=0;
    var flag=true;
    $(document).on('click','.checkbox',function () {
        if ($(this).checked=="" || $(this).checked==false){
            $(this).checked=flag;
            flag=false;
        }else if($(this).checked==true){
            $(this).checked=flag;
        }
        var checkeds=$(".checkbox");
            if ($(this).prop("checked")==true){
                count++;
                money+=parseInt($(this).parent().next().next().next().next().children(".sum").text());
            }else if($(this).prop("checked")==false){
                count--;
                money-=parseInt($(this).parent().next().next().next().next().children(".sum").text());
            }
        $(".count").text(count);          //商品数量
        $(".summoney").text(money);       //总价
    })
    /*加减*/
    $(document).on('click','.increment',function () {
        let nexts=$(this).parent().children(".itxt");
        let count=parseInt(nexts.val())+1;
        if ($(this).text()=='+'){
            if (count>=99){
                alert("不能再加了");
                return;
            }
            nexts.val(count);
            let price=$(this).parent().prev().children('.price ');
            let unitPrice=JSON.stringify(price);
            unitPrice=parseInt(price.text());
            let quantity=parseInt(nexts.val());
            let sum=$(this).parent().next().children('.sum');
            sum.text(unitPrice * quantity);
            if ($(this).parents("ul").find(":checkbox").prop('checked')==true){
                let sum=$(this).parent().next().children('.sum').text();
                let summoney=parseInt($(".summoney").text())+unitPrice;
                    $(".summoney").text(summoney);
            }
        }

        let next=$(this).parent().children(".itxt");
        count=parseInt(next.val())-1;
        if ($(this).text()=='-'){
            if (count<1){
                alert("不能再减了");
                return;
            }
            next.val(count);
            let price=$(this).parent().prev().children('.price ');
            let unitPrice=JSON.stringify(price);
            unitPrice=parseInt(price.text());
            let quantity=parseInt(next.val());
            let sum=$(this).parent().next().children('.sum');
            sum.text(unitPrice*quantity);
            if ($(this).parents("ul").find(":checkbox").prop('checked')==true){
                console.log($(this).parents("ul").find(":checkbox").prop('checked'));
                let sum=$(this).parent().next().children('.sum').text();
                console.log(sum);
                let summoney=parseInt($(".summoney").text())-unitPrice;
                $(".summoney").text(summoney);
            }
        }
    })



    /*删除购物车*/
    $(document).on('click','.delete',function () {

        let id=$(this).prev().text();
        let array=new Array();
        array.push(id);
        $.ajax({
            url:"/shopping/delete/cart",
            type:"post",
            data:{"id":array},
            dataType:"json",
            success:function (s) {
                $(".cart-item-list").children().remove();
                $.ajax({
                    url:"/shopping/cart/list",
                    type:"get",
                    data:goodsRequestDto,
                    dataType:"json",
                    success:function (s) {
                        console.log(s.data.shoppingCartDtoList.length);
                        for (let i = 0; i < s.data.shoppingCartDtoList.length; i++) {
                            $(".cart-item-list").append("<div class=\"cart-body\">\n" +
                                "<div class='cartId' style='display: none'>"+s.data.shoppingCartDtoList[i].id+"</div>\n"+
                                "                        <div class=\"cart-list\" style=\"display: block\">\n" +
                                "                            <ul class=\"goods-list yui3-g\" v-for=\"(cart,index) in carts\" :key=\"index\">\n" +
                                "                                <li class=\"yui3-u-1-24\">\n" +
                                "                                    <input type=\"checkbox\" class='checkbox' name=\"\" :value=\"cart\" v-model=\"selected\"value=\"\" />\n" +
                                "                                </li>\n" +
                                "                                <li class=\"yui3-u-11-24\">\n" +
                                "                                    <div class=\"good-item\">\n" +
                                "                                        <div class=\"item-img\">" +
                                "                                       <img class="+s.data.shoppingCartDtoList[i].gid+" src="+s.data.shoppingCartDtoList[i].goodsImgDtoList[i].goodsImg+" width=\"80px\" height=\"80px\"/></div><!--商品图片-->\n" +
                                "                                        <div class=\"item-msg\">\n" +
                                "                                        <span style=\"line-height:70px \">" +s.data.shoppingCartDtoList[i].productName+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+s.data.shoppingCartDtoList[i].specificationvalue+"</span>\n" +
                                "                                        </div>\n" +
                                "                                    </div>\n" +
                                "                                </li>\n" +
                                "                                <li class=\"yui3-u-1-8\"><span style=\"line-height:70px \" class=\"price\">"+s.data.shoppingCartDtoList[i].price+"</span></li>\n" +
                                "                                <li class=\"yui3-u-1-8\" style=\"padding-top: 20px\">\n" +
                                "                                    <a href=\"javascript:void(0)\" class=\"increment mins\" @click=\"decr(cart)\" >-</a>\n" +
                                "                                    <input autocomplete=\"off\" type=\"text\" v-model=\"cart.num\" value="+s.data.shoppingCartDtoList[i].quantity+" minnum=\"1\" class=\"itxt\" />\n" +
                                "                                    <a href=\"javascript:void(0)\" class=\"increment plus\" @click=\"incr(cart)\">+</a>\n"+
                                "                                </li>\n" +
                                "                                <li class=\"yui3-u-1-8\"><span style=\"line-height:70px \" class=\"sum\">"+(s.data.shoppingCartDtoList[i].quantity*s.data.shoppingCartDtoList[i].price)+"</span></li>\n" +
                                "                                <li class=\"yui3-u-1-8\">\n" +
                                "                                   <a class='cid' style='display: none'>"+s.data.shoppingCartDtoList[i].id+"</a>"+
                                "                                    <a href=\"javascript:void (0);\"  class='delete'>删除</a><br />\n" +
                                "                                    <a href=\"#none\">移到我的关注</a>\n" +
                                "                                </li>\n" +
                                "                            </ul>\n" +
                                "                        </div>\n" +
                                "                    </div>");
                        }
                    }
                })
            }
        })
    })
    $.ajax({
        url:"/shopping/query/cart",
        type:"post",
        dataType:"json",
        success:function (s) {
           $("#count").append(s.data);
        }
    })
    /*翻页*/
    $(document).on('click','.pageIndex',function () {
        let index=$(".index").val();            //当前页
        let totalPage=$(".totalPage").val();    //总页数
            if ($(".pageIndex").val()==1){
                if (index<=0){
                    alert("不能再往前了");
                    return
                }
                index--;
            }else if($(".pageIndex").val()==0){
                if (index>=totalPage){
                    alert("不能再往下了");
                    return;
                }
                index++;
            }
        var goodsRequestDto={
                "pageIndex":index
        }
        $.ajax({
            url:"/shopping/cart/list",
            type:"get",
            data:goodsRequestDto,
            dataType:"json",
            success:function (s) {
                console.log(s);
                $(".cart-item-list").children().remove();
                $(".totalPage").val(s.data.totalPage);
                $(".index").val(s.data.pageIndex);
                $(".totalRows").text(s.data.totalRows);
                for (let i = 0; i < s.data.shoppingCartDtoList.length; i++) {
                    $(".cart-item-list").append("<div class=\"cart-body\">\n" +
                        "<div class='cartId' style='display: none'>"+s.data.shoppingCartDtoList[i].id+"</div>\n"+
                        "                        <div class=\"cart-list\" style=\"display: block\">\n" +
                        "                            <ul class=\"goods-list yui3-g\" v-for=\"(cart,index) in carts\" :key=\"index\">\n" +
                        "                                <li class=\"yui3-u-1-24\">\n" +
                        "                                    <input type=\"checkbox\"     class='checkbox'  name=\"\" :value=\"cart\" v-model=\"selected\"value=\"\" />\n" +
                        "                                </li>\n" +
                        "                                <li class=\"yui3-u-11-24\">\n" +
                        "                                    <div class=\"good-item\">\n" +
                        "                                        <div class=\"item-img\">" +
                        "                                       <img class="+s.data.shoppingCartDtoList[i].gid+" src="+s.data.shoppingCartDtoList[i].goodsImg+" width=\"80px\"  height=\"80px\"/></div><!--商品图片-->\n" +
                        "                                        <div class=\"item-msg\">\n" +
                        "<span style=\"line-height:70px \">" +s.data.shoppingCartDtoList[i].productName+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+s.data.shoppingCartDtoList[i].specificationvalue+"</span>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                </li>\n" +
                        "                                <li class=\"yui3-u-1-8\"><span style=\"line-height:70px \" class=\"price\">"+s.data.shoppingCartDtoList[i].price+"</span></li>\n" +
                        "                                <li class=\"yui3-u-1-8\" style=\"padding-top: 20px\">\n" +
                        "                                    <a href=\"javascript:void(0)\" class=\"increment mins\" @click=\"decr(cart)\" >-</a>\n" +
                        "                                    <input autocomplete=\"off\" type=\"text\" v-model=\"cart.num\" value="+s.data.shoppingCartDtoList[i].quantity+" minnum=\"1\" class=\"itxt\" />\n" +
                        "                                    <a href=\"javascript:void(0)\" class=\"increment plus\" @click=\"incr(cart)\">+</a>\n"+
                        "                                </li>\n" +
                        "                                <li class=\"yui3-u-1-8\"><span style=\"line-height:70px \" class=\"sum\">"+(s.data.shoppingCartDtoList[i].quantity*s.data.shoppingCartDtoList[i].price)+"</span></li>\n" +
                        "                                <li class=\"yui3-u-1-8\">\n" +
                        "                                   <a class='cid' style='display: none'>"+s.data.shoppingCartDtoList[i].id+"</a>"+
                        "                                    <a href=\"javascript:void (0);\"  class='delete'>删除</a><br />\n" +
                        "                                    <a href=\"#none\">移到我的关注</a>\n" +
                        "                                </li>\n" +
                        "                            </ul>\n" +
                        "                        </div>\n" +
                        "                    </div>");
                }
            }
        })
    })
    
    $(document).on('click','.item-img',function () {
       let goodId=$(this).children('img').attr("class");
        window.location.href="/merchandise/skip/item/" + goodId;
    })

        $(document).on('click','.balance',function () {
            let goodMap={

            }
            $(".checkbox").each(function () {
                if ($(this).prop("checked")==true){
                    goodMap[$(this).parent().parent().parent().parent().find('.cartId').text()]= $(this).parent().next().next().next().find(".itxt").val();
                }
            })
            let map=JSON.stringify(goodMap);
            $(".gId").val(map);
            $("form").submit();
        })
</script>
</html>